import java.util.ArrayList;

public class db_parse_result_show_tables implements db_interface_parse_result{
	private int iRes = 0;

	public int get_result() {
		return iRes;
	}
	public void set_result(int iResult) {
		iRes = iResult;
	}
	public db_interface_result run_query(db_server oServer, db_session oSession){
		
		db_database oDb =  oServer.oDatabases.get(oSession.iCurrentDatabase);

		ArrayList<db_column> oCols = new ArrayList<db_column>();
		oCols.add(new db_column("Name", db_util.DB_DATATYPE_VARCHAR, 128));

		db_bytes oByteData = new db_bytes(132 * oDb.oTables.size());
		for (int i = 0; i < oDb.oTables.size(); i++)
			oByteData.write(oDb.oTables.get(i).sName, oCols.get(0).lLength);
		
		return new db_result_dataset(oCols, oDb.oTables.size(), oByteData.getBytes());
	} 
}
